<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" href="../css/reset.css">
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../fonts/iconfont/iconfont.css">
    <link rel="stylesheet" href="../css/index.css" />
    <title>货栈</title>
    <script src="../js/comment.js"></script>
    <script type="text/javascript">
        function setId(id) {
            window.localStorage.setItem("id", id); //保存数据
        }
        // 请求用户登录数据
        function openPickUpPage() {
            window.WebViewJavascriptBridge.callHandler(
                'openPickUpPage', {
                    'param': 'hhhhh'
                },
                function(responseData) {}
            );
        }

        var id, storeId;

        if (isIOS()) {
            getAppUserInfo(function(res) {
                var obj = {
                    token: res.token,
                    mobile: res.mobile,
                    id: res.bossId,
                    storeId: res.lastStore,
                    storeSn: res.storeSn
                }
                obj = JSON.stringify(obj)
                window.localStorage.setItem("obj", obj)

            });

        } else if (isAndroid()) {
            // 请求用户登录数据
            function getUserInfo() {
                window.WebViewJavascriptBridge.callHandler(
                    'getUserInfo', {
                        'param': 'getUserInfo'
                    },
                    function(responseData) {
                        console.log("responseData：" + responseData)
                        alert(responseData)
                    }
                );
            }

            function connectWebViewJavascriptBridge(callback) {
                if (window.WebViewJavascriptBridge) {
                    callback(WebViewJavascriptBridge)
                } else {
                    document.addEventListener(
                        'WebViewJavascriptBridgeReady',
                        function() {
                            callback(WebViewJavascriptBridge)
                        },
                        false
                    );
                }
            }

            connectWebViewJavascriptBridge(function(bridge) {
                bridge.init(function(message, responseCallback) {
                    console.log('JS got a message', message);

                });

                // 一打开应用模块我就把你所需要的参数发送给你， 就是data
                bridge.registerHandler("functionInJs", function(data, responseCallback) {
                    var obj = data
                    window.localStorage.setItem("obj", obj)
                    var responseData = "Javascript 收到原生的方法，现在回调给原生：" + data;
                    responseCallback(responseData);

                });
            });
        }


        //跳转新页面

        function openNewPage(url) {
            if (isAndroid()) {
                window.WebViewJavascriptBridge.callHandler(
                    'openNewPage', {
                        'param': url
                    },
                    function(responseData) {}
                );
            } else if (isIOS()) {
                window.location.href = url
            }
        }
    </script>
</head>

<body>

    <header class="aui-bar aui-bar-nav aui-bar-light" style="background: #4e536c;">
        <a class="aui-pull-left aui-btn" onclick="AppGoBack()">
            <span class="aui-iconfont aui-icon-left" style="color: #FFFFFF;"></span>
        </a>
        <div class="aui-title" style="color: #FFFFFF;">粉丝e栈</div>
    </header>
    <div class="content">
        <ul class="list">
            <li>
                <div class="box">
                    <a onclick="openNewPage('e_wealth.html')">
                        <div class="box-flex">
                            <img src="../images/e.png" alt="E卡派送">
                            <span>E卡派送</span>
                        </div>
                    </a>
                    <a href="javascript:;">
                        <div class="box-flex">
                        </div>
                    </a>
                    <a href="javascript:;">
                        <div class="box-flex">
                        </div>
                    </a>
                    <a href="#">
                        <div class="box-flex"></div>
                    </a>
                </div>
            </li>


        </ul>
    </div>

</body>

</html>